﻿@page "/"
@inject NavigationManager navigator

<div>
	<Counter Embedded="true" />
	@*Passes a random number between 1 and 10 as an input to the Counter component*@
	<button class="btn btn-outline-primary btn-sm" @onclick="() => Navigate(Random.Shared.Next(1, 11))">Navigate with a Random value</button>

	<br />
	<br />

	This is a <a href="#" @onclick="Invalid">Broken Link</a>.
	@*This is a <a href="/random-counter">Broken Link</a>.*@
</div>

@code {
	private void Navigate(int startWith)
	{
		navigator.NavigateTo($"/counter/{startWith}");
	}

	private void Invalid()
	{
		navigator.NavigateTo("/random-counter");
	}
}